<template>
  <c-card isAffix>
    <c-table
      row-key="id"
      class="table-template__table"
      :loading="loading"
      :data="tableData"
      v-model:search="searchParams"
      v-model:paging="paging"
      @refresh="queryTableData"
    >
      <!-- 搜索栏 -->
      <template #search>
        <c-input v-model="searchParams.userid" placeholder="请输入userid" />
      </template>
      <!-- 表格 -->
      <template #table>
        <el-table-column prop="user_id" label="userId" width="220" />
        <el-table-column prop="type" label="类型" width="120" />
        <el-table-column prop="ip" label="ip" width="180" />
        <el-table-column label="创建时间" width="180">
          <template #default="{ row }">
            {{ dayjs(row.create_date).format('YYYY-MM-DD HH:mm:ss') }}
          </template>
        </el-table-column>
        <el-table-column prop="ua" label="ua" min-width="300" />
      </template>
    </c-table>
  </c-card>
</template>

<script setup name="el-encap.table-template">
import { ref, computed, onMounted } from 'vue';

// hooks
import { useTable } from '@/hooks/useTable/index.js';
import { useFetch } from '@/hooks/useFetch/index.js';

// components
import { MessageBox } from '@/utils/message-box';
import { ElMessage } from 'element-plus';

// router
import { useRouter } from 'vue-router';
const router = useRouter();

// store modal
import { useModalStore } from '@/pinia/modules/modal';
const modalStore = useModalStore();

// user
import { useUserStore } from '@/pinia/modules/user.js';
const userStore = useUserStore();

import { pageListUserLog } from '@/apis/user';

import { UserPlatform } from '@/config/global-variable';

import dayjs from 'dayjs';

// 表格相关
const { loading, paging, searchParams, tableData, queryTableData, delTableRow } = useTable({
  api: pageListUserLog,
  params: {
    uni_platform: '',
    userid: '',
  },
  options: {},
  callBack: () => {},
});

onMounted(() => {});
</script>

<style lang="scss" scoped></style>
